import MncCity from './modules/mnc_city'
import MncIndustry from './modules/mnc_industry'
import MncJob from './modules/mnc_job'
import City from './modules/city'
import Company_type from './modules/company_type'
import Education_backgroud from './modules/education_backgroud'
import Language_level from './modules/language_level'
import Industry from './modules/industry'
import Job from './modules/job'
import Nationality from './modules/nationality'
import Candidate_status from './modules/candidate_status'
import LIST_FOLDER from './modules/folder'
import moment from 'moment'
export default {
  mnc_city: MncCity.data,
  mnc_industry: MncIndustry.data,
  mnc_job: MncJob.data,
  target_type: [
    { key: 'invoice', display_name: '发票' },
    { key: 'project', display_name: '项目' },
    { key: 'cv', display_name: 'CV推荐' }
  ],
  is_handel_options: [
    { key: 'all', display_name: '全部' },
    { key: '1', display_name: '已处理' },
    { key: '0', display_name: '待处理' }
  ],
  bulletin_status: [
    { key: 'all', display_name: '全部' },
    { key: 'draft', display_name: '草稿' },
    { key: 'published', display_name: '发布' },
    { key: 'del', display_name: '已删除' }
  ],
  marriage: [
    { key: '0', display_name: '未知' },
    { key: '1', display_name: '未婚' },
    { key: '2', display_name: '已婚未育' },
    { key: '3', display_name: '已婚已育' }
  ],
  gender: [
    { key: '0', display_name: '未知' },
    { key: '1', display_name: '男' },
    { key: '2', display_name: '女' }
  ],
  userStatus: [
    { key: 'on', display_name: '在职' },
    { key: 'off', display_name: '离职' },
    { key: 'freeze', display_name: '冻结' }
  ],
  contact_people_degree: [
    { key: '1', display_name: '非常重要' },
    { key: '2', display_name: '重要' },
    { key: '3', display_name: '一般' },
    { key: '4', display_name: '较弱' },
    { key: '5', display_name: '离职' }
  ],
  guarantee_period: [
    { key: '0', display_name: '0 月' },
    { key: '1', display_name: '1 月' },
    { key: '2', display_name: '2 月' },
    { key: '3', display_name: '3 月' },
    { key: '4', display_name: '4 月' },
    { key: '5', display_name: '5 月' },
    { key: '6', display_name: '6 月' },
    { key: '7', display_name: '7 月' },
    { key: '8', display_name: '8 月' },
    { key: '9', display_name: '9 月' },
    { key: '10', display_name: '10 月' },
    { key: '11', display_name: '11 月' },
    { key: '12', display_name: '12 月' }
  ],
  project_status: [
    { key: 'Applying', display_name: '申请中', actions: ['apply'] },
    { key: 'Wait_approve', display_name: '等待审核', actions: ['check', 'cancel'] },
    { key: 'No_pass', display_name: '不通过', actions: ['apply'] },
    { key: 'Live', display_name: '正在进行', actions: ['stop', 'complete'] },
    { key: 'Successful', display_name: '完成关闭', actions: [] },
    // { key: 'Failed', display_name: '失败' },
    { key: 'Pending', display_name: '暂停', actions: ['restart'] }
    // { key: 'Cancelled', display_name: '取消' }
  ],
  project_priority: [
    { key: 'High', display_name: '高' },
    { key: 'Mid', display_name: '中' },
    { key: 'Low', display_name: '低' }
  ],
  fee_type: [
    {
      key: 'employment',
      display_name: '招聘服务费'
    },
    {
      key: 'message',
      display_name: '资讯费用'
    },
    {
      key: 'down_payment',
      'display_name': '定金'
    },
    {
      key: 'other',
      display_name: '其他'
    }],
  invoice_type: [
    {
      key: 'normal',
      display_name: '普票'
    },
    {
      key: 'private',
      display_name: '专票'
    }
  ],
  city: City.data,
  company_type: Company_type.data,
  education_backgroud: Education_backgroud.data,
  language_level: Language_level.data,
  industry: Industry.data,
  job: Job.data,
  nationality: Nationality.data,
  candidate_status: Candidate_status.data,
  office: [
    { key: '1', display_name: '苏州' },
    { key: '2', display_name: '上海' },
    { key: '3', display_name: '成都' }
    // { key: '4', display_name: '深圳' }
  ],
  list_folder: LIST_FOLDER.data,
  cv_status: [
    { key: 'add_project', display_name: '加入项目', next_status_group: ['sent_to_manager', 'out'] },
    { key: 'sent_to_manager', display_name: '已推荐给客户经理', next_status_group: ['sent_to_client', 'out'] },
    { key: 'sent_to_client', display_name: '已推荐给客户', next_status_group: ['interview', 'interview_end', 'out'] },
    { key: 'interview', display_name: '面试', next_status_group: ['interview', 'interview_end', 'sign_offer', 'out'] },
    { key: 'interview_end', display_name: '终面', next_status_group: ['sign_offer', 'out'] },
    { key: 'sign_offer', display_name: '签订offer', next_status_group: ['onboading', 'out'] },
    { key: 'onboading', display_name: '入职', next_status_group: ['sent_over', 'out'] },
    { key: 'sent_over', display_name: '过保证期', next_status_group: [] },
    { key: 'out', display_name: '淘汰', next_status_group: [] }
  ],
  invoice_status: [
    { key: 'applying', display_name: '申请中', actions: ['apply'] },
    { key: 'wait_approve', display_name: '等待审批', actions: ['back', 'check'] },
    { key: 'no_pass', display_name: '未审批通过', actions: ['apply'] },
    { key: 'approved', display_name: '已审批', actions: ['bill', 'repulse'] },
    { key: 'bill', display_name: '已开票', actions: ['alloc', 'cancel', 'print'] },
    { key: 'cancel', display_name: '作废', actions: [] },
    { key: 'receipt', display_name: '已回款', actions: ['settle_accounts', 'refund'] },
    { key: 'refund', display_name: '退款', actions: ['settle_accounts'] },
    { key: 'balanced', display_name: '已结算', actions: ['refund'] },
    { key: 'finish', display_name: '完成关闭', actions: [] },
    { key: 'settle_accounts', display_name: '季度结账', actions: ['balanced', 'finish'] }
  ],
  project_role: [
    { key: 'bd', display_name: 'BD', proportion: 10 },
    { key: 'customer_retention', display_name: '客户经理', proportion: 10 },
    { key: 'mapping', display_name: 'Mapping', proportion: 10 },
    { key: 'candidate_bd', display_name: '候选人开发', proportion: 20 },
    { key: 'candidate_cv', display_name: '候选人推荐', proportion: 30 },
    { key: 'candidate_follow', display_name: '候选人Follow', proportion: 20 }
  ],
  business_roles: [
    'bd',
    'client_manager',
    'manager_consultant',
    'consultant'
  ],
  mini_roles: {
    MINI_P_OFFICE: 'OFFICE',
    MINI_P_DEPT: 'DEPT'
  },
  pickerOptions: {
    shortcuts: [{
      text: '今日',
      onClick(picker) {
        const end_str = moment().format('YYYY-MM-DD') + ' 23:59:59'
        const end = moment(end_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        const start_str = moment().format('YYYY-MM-DD') + ' 00:00:00'
        const start = moment(start_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '本周',
      onClick(picker) {
        const end_str = moment().day(7).format('YYYY-MM-DD') + ' 23:59:59'
        const end = moment(end_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        const start_str = moment().day(1).format('YYYY-MM-DD') + ' 00:00:00'
        const start = moment(start_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '本月',
      onClick(picker) {
        const end_str = moment().endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
        const end = moment(end_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        const start_str = moment().startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
        const start = moment(start_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        console.log(start_str, end_str)
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '全年',
      onClick(picker) {
        const end_str = moment().endOf('year').format('YYYY-MM-DD') + ' 23:59:59'
        const end = moment(end_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        const start_str = moment().startOf('year').format('YYYY-MM-DD') + ' 00:00:00'
        const start = moment(start_str, 'YYYY-MM-DD HH:mm:ss').format('x')
        console.log(start_str, end_str)
        picker.$emit('pick', [start, end])
      }
    }]
  }
}
